<?xml version="1.0"?>
<jsp:root 	xmlns:jsp="http://java.sun.com/JSP/Page"
 			xmlns:c="http://java.sun.com/jsp/jstl/core"
 			xmlns="http://www.w3.org/1999/xhtml"
 			version="2.1">
 
 <jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
 <jsp:directive.page isELIgnored="false" />
 <jsp:output 	omit-xml-declaration="false" 
 			 	doctype-root-element="HTML" 
 				doctype-system="about:legacy-compat" />
 
 <jsp:useBean id="datosLogin" class="es.javamyadmin.beans.LoginBean" scope="session" />
 
 <jsp:useBean id="listaTablesBean" class="es.javamyadmin.beans.ListaTablesBean" scope="session" />
 
 <jsp:setProperty property="user" name="listaTablesBean" value="${datosLogin.usuario}" />
 <jsp:setProperty property="pass" name="listaTablesBean" value="${datosLogin.password}" />
 <jsp:setProperty property="host" name="listaTablesBean" value="${datosLogin.servidor}" />
 <jsp:setProperty property="port" name="listaTablesBean" value="${datosLogin.puerto}" />
 <c:if test="${param.bd != null }">
 	<jsp:setProperty property="database" name="listaTablesBean" value="${param.bd}" />
 </c:if>
 <c:if test="${param.tabla != null }">
 	<jsp:setProperty property="table" name="listaTablesBean" value="${param.tabla}" />
 </c:if>

<html>
<head>

<link rel="icon" href="${pageContext.request.contextPath}/images/icons/favicon.png" type="image/x-icon"/>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/icons/favicon.png" type="image/x-icon" />

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/reset.css" media="screen" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/java-admin.css" media="screen" />

<title>JavaMyAdmin</title>

</head>

<body onload="cargarTablas('${listaTablesBean.user}','${listaTablesBean.pass}','${listaTablesBean.host}','${listaTablesBean.port}','${listaTablesBean.database}')">

<div id="wrapper">
<div id="todo">

<div id="contenedor">
	
	<jsp:include page="../includes/sidebar-left.jsp" />
	
	<div id="contenido">
	
		<jsp:include page="../includes/cabecera.jsp" />
		
		<h2>Base de datos: <c:out value="${listaTablesBean.database}"></c:out> >> Tabla: <c:out value="${listaTablesBean.table}"></c:out></h2>
		<jsp:include page="../includes/menu-tabla-superior.jsp" />
				
		<!-- Errores (no hace falta) -->
		<c:if test="${error!=null}"><div id="ko"  class="aviso"><div class="pro_aviso ko"><p>${error }<c:if test="${descripcion != null}"><a id="especial" data-toggle="modal" href="#windowTitleDialog" onclick="cargarDatosMsj('6', '${descripcion}', '');" style="font-size:'10px'; "> (más)</a></c:if></p></div></div></c:if>		
		<c:if test="${ok!=null}"><div class="aviso"><div class="pro_aviso ok"><p><c:out value="${ok}"></c:out></p></div></div></c:if>
		
		
		<table id="lista-tablas">		
			<tr>
				<th style="border-radius: 5px 0 0 0;">CAMPOS</th>
				<th>TIPO</th>
				<th>NULL</th>
				<th>KEY</th>
				<th>DEFAULT</th>
				<th style="border-radius: 0 5px 0 0;">EXTRA</th>
			</tr>
		
			<c:forEach var="lista" items="${listaTablesBean.describe}">			
				<tr>
					<td><c:out value="${lista.nombreColum}"></c:out></td>
					<td align="center"><c:out value="${lista.tipoColum}"></c:out></td>
					<td align="center"><c:out value="${lista.nullColum}"></c:out></td>
					<td align="center"><c:out value="${lista.keyColum}"></c:out></td>
					<td align="center"><c:out value="${lista.defaultColum}"></c:out></td>
					<td align="center"><c:out value="${lista.extraColum}"></c:out></td>
				</tr>
			</c:forEach>
			
	 	</table>
	 		
	</div>

</div>

</div>
</div>
</body>
</html>
</jsp:root>